<?php
declare (strict_types=1);

namespace app\api\validate;

use think\Validate;

class Draw extends Validate
{
    protected $rule = [
        "account" => "require",
        "mode" => "require",
        "amount" => "require|gt:0|checkInt"
    ];

    protected $message = [
        'account.require' => '请选择提现账户',
        'mode.require' => '请选择提现方式',
        'amount.require' => '请填写提现金额',
        'amount.gt' => '提现金额有误',
        'amount.checkInt' => '提现金额必须为整数'
    ];

    protected function checkInt($value, $rule, $data = []): bool
    {
        return (string)(int)$value === $value;
    }
}